/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "CAU_STORE", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CauStore.findAll", query = "SELECT c FROM CauStore c"),
    @NamedQuery(name = "CauStore.findByMaTinh", query = "SELECT c FROM CauStore c WHERE c.cauStorePK.maTinh = :maTinh"),
    @NamedQuery(name = "CauStore.findByCauId", query = "SELECT c FROM CauStore c WHERE c.cauStorePK.cauId = :cauId"),
    @NamedQuery(name = "CauStore.findByNgayQuay", query = "SELECT c FROM CauStore c WHERE c.ngayQuay = :ngayQuay"),
    @NamedQuery(name = "CauStore.findByViTri1", query = "SELECT c FROM CauStore c WHERE c.viTri1 = :viTri1"),
    @NamedQuery(name = "CauStore.findByViTri2", query = "SELECT c FROM CauStore c WHERE c.viTri2 = :viTri2"),
    @NamedQuery(name = "CauStore.findByValue1", query = "SELECT c FROM CauStore c WHERE c.value1 = :value1"),
    @NamedQuery(name = "CauStore.findByValue2", query = "SELECT c FROM CauStore c WHERE c.value2 = :value2"),
    @NamedQuery(name = "CauStore.findByKetQua", query = "SELECT c FROM CauStore c WHERE c.ketQua = :ketQua")})
public class CauStore implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CauStorePK cauStorePK;
    @Size(max = 4000)
    @Column(name = "NGAY_QUAY")
    private String ngayQuay;
    @Column(name = "VI_TRI_1")
    private BigInteger viTri1;
    @Column(name = "VI_TRI_2")
    private BigInteger viTri2;
    @Size(max = 2000)
    @Column(name = "VALUE_1")
    private String value1;
    @Size(max = 2000)
    @Column(name = "VALUE_2")
    private String value2;
    @Size(max = 2000)
    @Column(name = "KET_QUA")
    private String ketQua;

    public CauStore() {
    }

    public CauStore(CauStorePK cauStorePK) {
        this.cauStorePK = cauStorePK;
    }

    public CauStore(String maTinh, BigInteger cauId) {
        this.cauStorePK = new CauStorePK(maTinh, cauId);
    }

    public CauStorePK getCauStorePK() {
        return cauStorePK;
    }

    public void setCauStorePK(CauStorePK cauStorePK) {
        this.cauStorePK = cauStorePK;
    }

    public String getNgayQuay() {
        return ngayQuay;
    }

    public void setNgayQuay(String ngayQuay) {
        this.ngayQuay = ngayQuay;
    }

    public BigInteger getViTri1() {
        return viTri1;
    }

    public void setViTri1(BigInteger viTri1) {
        this.viTri1 = viTri1;
    }

    public BigInteger getViTri2() {
        return viTri2;
    }

    public void setViTri2(BigInteger viTri2) {
        this.viTri2 = viTri2;
    }

    public String getValue1() {
        return value1;
    }

    public void setValue1(String value1) {
        this.value1 = value1;
    }

    public String getValue2() {
        return value2;
    }

    public void setValue2(String value2) {
        this.value2 = value2;
    }

    public String getKetQua() {
        return ketQua;
    }

    public void setKetQua(String ketQua) {
        this.ketQua = ketQua;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cauStorePK != null ? cauStorePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CauStore)) {
            return false;
        }
        CauStore other = (CauStore) object;
        if ((this.cauStorePK == null && other.cauStorePK != null) || (this.cauStorePK != null && !this.cauStorePK.equals(other.cauStorePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.CauStore[ cauStorePK=" + cauStorePK + " ]";
    }
    
}
